// 修饰符
class Ysx{
   public name:string;
   private age:number;
   protected sex:string
constructor(name:string,age:number,sex:string){
    this.name=name;
    this.age=age;
    this.sex=sex;
}
show():void{
    console.log(this.name);
    console.log(this.age);
}
}
let mjl=new Ysx('宝宝',16,'女');
console.log(mjl);
console.log(mjl.name)
// console.log(mjl.age)

class Jyn extends Ysx{
    constructor(name:string,age:number,sex:string){
        super(name,age,sex)
    }
    test():void{
        console.log(this.sex);
    }
}
let qwe =new Jyn('吃饭',777,'女')
console.log(qwe)
qwe.test();

class QAS{
    constructor(public name:string,public age:number){
        this.name=name;
        this.age=age;
    }
}

let yangyang=new QAS('sss',45);
console.log(yangyang)

// get set
class Mu{
    name:string='睡觉'
    hobby:string='打游戏哦'
    constructor(name:string,hobby:string){
        this.name=name;
        this.hobby=hobby
    }
    get kl():string{
        return this.name+this.hobby;
    }
    set kl(value){
        console.log(value)
    }
}
let xiaohongshu=new Mu('和平','打');
console.log(xiaohongshu);
xiaohongshu.kl='okkkkk'

// 抽象类
abstract class Pages{
   
    abstract run();
    abstract jump();
}
class Boy extends Pages{
 run (){
        console.log('子');
    }
    jump(){
        console.log('跑步')
    }
}
let Danny=new Boy();
Danny.run();
Danny.jump();